package com.lyh.service.user;

import com.lyh.dao.User.UserMapper;
import com.lyh.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
/*@Service*/
public class UserServiceImpl implements UserService {

    /*@Autowired*/
    private UserMapper userMapper;

    public void setUserMapper(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @Override
    public List<User> getUserList() { return userMapper.getUserList(); }

    @Override
    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    @Override
    public List<User> getUserListByNameAndRole(Map<String, Object> map) {
        return userMapper.getUserListByNameAndRole( map);
    }

    // 用户登录 验证
    @Override
    public User checkLogin(Map<String, String> map) { return userMapper.checkLogin(map); }


    @Override
    public int modifyPassword(Integer id, String password) {
        return userMapper.modifyPassword(id, password);
    }

    @Override
    public int getUserCount(Map<String, Object> map) {
        return userMapper.getUserCount(map);
    }

    @Override
    public int modifyUser(User user) {
        return userMapper.modifyUser(user);
    }

    @Override
    public int userAdd(User user) {
        return userMapper.userAdd(user);
    }

    @Override
    public List<User> checkUserCode(String userCode) {
        return userMapper.checkUserCode(userCode);
    }

    @Override
    public int deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }
}
